<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Classes extends Model
{
    //初中
    const MIDDLE = '01';
    //高中
    const SENIOR = '02';
    protected $fillable = [ 'type','g_cod', 'c_code','name'];

    public static function grade(): array
    {
        return [self::MIDDLE=>'初中', self::SENIOR=>'高中'];
    }

    public function teachers() {
        return $this->hasOne(Teacher::class, 'tc_code', 'tc_code');
    }
}
